#ifndef CNODE_H
#define CNODE_H

#include <math.h>
#include "parameters.h"


class CNode
{
    public:
        CNode(int nid, double x, double y, double z);
        virtual ~CNode();
        double getCoord(int dir);
        double getDistance(CNode *n);
        int getId();
        void setDisplacement(int dir, double v);
        void setForce(int dir, double v);
        bool checkDisplacement(int n);
        bool checkForce(int n);
        bool checkUnknown();
        double getBCValue(int n);
        void setUnknownForce(CNode *n);
        double getUnknownDirection(int n);
        void setRestriction(int dir);
        bool getRestriction(int dir);
        void setSolution(int dir, double v);
        double getSolution(int dir);
        void setUnknownSolution(int dir, double v);
        double getUnknownSolution(int dir);
        void setBilateralUnknownForce(CNode *n);
        bool checkBilateralUnknown();
        CNode* getBilateralUnknownNode();
    protected:
    private:
        double coords[3];
        int id;
        bool bcset[6];
        bool forceset[6];
        bool unknown;
        double bcvalue[6];
        double unknownDirection[3];
        bool restricted[6];
        double solution[6];
        double unknownSolution[3];
        bool bilateralUnknown;
        CNode *bilateralUnknownNode;
};

#endif // CNODE_H
